﻿@using Localization.Resources.AbpUi
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.MultiTenancy
@using Volo.Abp.UI.Navigation
@using Volo.Abp.Users
@inject ICurrentUser CurrentUser
@inject ICurrentTenant CurrentTenant
@inject IHtmlLocalizer<AbpUiResource> L
@model ApplicationMenu
    <!-- User Account: style can be found in dropdown.less -->
    <li class="dropdown user user-menu">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <img src="~/themes/adminlte/img/user2-160x160.jpg" class="user-image" alt="User Image">
            <span class="hidden-xs">@CurrentUser.UserName</span>
        </a>
        <ul class="dropdown-menu">
            <!-- User image -->
            <li class="user-header">
                <img src="~/themes/adminlte/img/user2-160x160.jpg" class="img-circle" alt="User Image">

                <p>
                    @CurrentUser.UserName
                    <small>@CurrentUser.Email</small>
                </p>
            </li>
            <!-- Menu Body -->
            <li class="user-body" style="display:none;">
                <div class="row">
                    <div class="col-xs-4 text-center">
                        <a href="#">Followers</a>
                    </div>
                    <div class="col-xs-4 text-center">
                        <a href="#">Sales</a>
                    </div>
                    <div class="col-xs-4 text-center">
                        <a href="#">Friends</a>
                    </div>
                </div>
                <!-- /.row -->
            </li>
            <!-- Menu Footer-->
            <li class="user-footer">
                @{
                    int userMenuIndex = 1;
                    int userMenuCount = Model.Items.Count;
                    foreach (var menuItem in Model.Items)
                    {
                        var elementId = string.IsNullOrEmpty(menuItem.ElementId) ? string.Empty : $"id=\"{menuItem.ElementId}\"";
                        var cssClass = string.IsNullOrEmpty(menuItem.CssClass) ? string.Empty : menuItem.CssClass;
                        var disabled = menuItem.IsDisabled ? "disabled" : string.Empty;

                        @*<a class="dropdown-item @cssClass @disabled" href="@(menuItem.Url ?? "#")" target="@menuItem.Target" @Html.Raw(elementId)>
                                @menuItem.DisplayName
                            </a>*@

                        <div class="@(userMenuIndex == userMenuCount ? "pull-right" : "pull-left")">
                            <a href="@(menuItem.Url ?? "#")" class="btn btn-default btn-flat">@menuItem.DisplayName</a>
                        </div>
                        userMenuIndex++;
                    }
                }
                @*<div class="pull-left">
                        <a href="~/Account/Manage" class="btn btn-default btn-flat">Profile</a>
                    </div>
                    <div class="pull-right">
                        <a href="~/Account/Logout" class="btn btn-default btn-flat">Sign out</a>
                    </div>*@
            </li>
        </ul>
    </li>
